import 'package:emojis/emoji.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:im_app/im/emojiOne/EmojiOne.dart';
import 'package:im_app/im/emojiOne/EmojiOneInfoes.dart';

void main() {
  test("stringReplace", () async {
    String str = '''adfas
    fasdaf
    adfssafaf
    ''';
    String d = str.replaceAll("\n", "");
    d = d.replaceAll("\n", "");
    print(d);


  });

  test("emoji paths", () async {
    await EmojiOneInfoes.getInstance().loadData();
    // people  nature food activity travel objects symbols flags
    List<EmojiOne> emojiOneList = EmojiOneInfoes.getInstance().getAllEmojiOnes();
    int total = 0;
    for (var emojiOne in emojiOneList) {
      var shorName = emojiOne.shortname.substring(1, emojiOne.shortname.length-1);
      var emoji = Emoji.byShortName(shorName);
      if (emoji == null) {
        var emojis = Emoji.byKeyword(shorName).toList();
        if (emojis.length < 1) {
          print("emoji is not exist: ${emojiOne.shortname}, ${emojiOne.unicode}");
          total ++;
        }
      }
    }
    print('size： ${emojiOneList.length}, total: $total, tt: ${Emoji.all().length}');
  });
}